#include "list.h"

void TestList1()
{
	//LTNode* plist = NULL;
	//ListInit(&plist);
	LTNode* plist = ListInit();
	ListPushBack(plist, 1);
	ListPushBack(plist, 2);
	ListPushBack(plist, 3);
	ListPushBack(plist, 4);
	ListPushBack(plist, 5);
	ListPrint(plist);
}

void InspectPushBack()
{
	printf("Inspect ListPushBack:\n");
	LTNode* plist = ListInit();
	ListPushBack(plist, 1);
	ListPushBack(plist, 2);
	ListPushBack(plist, 3);
	ListPushBack(plist, 4);
	ListPushBack(plist, 5);
	ListPrint(plist);
	printf("\n");
}

void InspectPushFront()
{
	printf("Inspect ListPushFront:\n");
	LTNode* plist = ListInit();
	ListPushFront(plist, 1);
	ListPushFront(plist, 2);
	ListPushFront(plist, 3);
	ListPushFront(plist, 4);
	ListPushFront(plist, 5);
	ListPrint(plist);
	printf("\n");
}

void InspectPopBack()
{
	printf("Inspect ListPopBack\n");
	LTNode* plist = ListInit();
	ListPushBack(plist, 1);
	ListPushBack(plist, 2);
	ListPushBack(plist, 3);
	ListPushBack(plist, 4);
	ListPushBack(plist, 5);
	ListPrint(plist);
	printf("Step 1: ");
	ListPopBack(plist);
	ListPrint(plist);
	printf("\n");
	printf("Step 2: ");
	ListPopBack(plist);
	ListPrint(plist);
	printf("\n");
	printf("Step 3: ");
	ListPopBack(plist);
	ListPrint(plist);
	printf("\n");
	printf("Step 4: ");
	ListPopBack(plist);
	ListPrint(plist);
	printf("\n");
	printf("Step 5: ");
	ListPopBack(plist);
	ListPrint(plist);
	printf("\n");
}

void InpsectPopFront()
{
	printf("Inspect ListPopFront:\n");
	LTNode* plist = ListInit();
	ListPushBack(plist, 1);
	ListPushBack(plist, 2);
	ListPushBack(plist, 3);
	ListPushBack(plist, 4);
	ListPushBack(plist, 5);
	ListPrint(plist);
	printf("Step 1: ");
	ListPopFront(plist);
	ListPrint(plist);
	printf("\n");
	printf("Step 2: ");
	ListPopFront(plist);
	ListPrint(plist);
	printf("\n");
	printf("Step 3: ");
	ListPopFront(plist);
	ListPrint(plist);
	printf("\n");
	printf("Step 4: ");
	ListPopFront(plist);
	ListPrint(plist);
	printf("\n");
	printf("Step 5: ");
	ListPopFront(plist);
	ListPrint(plist);
	printf("\n");
}

int main()
{
	TestList1();
	InspectPushBack();
	InspectPushFront();
	InspectPopBack();
	InpsectPopFront();
	return 0;
}